﻿#ifndef MOCKINTERFACE_H
#define MOCKINTERFACE_H

#include <QObject>
#include <QVariant>
#include <QVariantList>
#include <QVariantMap>
#include <QRandomGenerator>
#include <QQuickItem>
#include <QTime>
#include <QWidget>
#include <QLabel>
#include <QHBoxLayout>
#include <QQuickWidget>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QMainWindow>

#include <QDebug>

#include "qmlSignal.h"
#include "widgetanchor.h"

/* 前端测试用，模拟后端接口类 */
class MockInterface : public QObject
{
    Q_OBJECT

signals:
    void testMock(int num); // c++toqml

public:
    MockInterface();

    Q_INVOKABLE void            activeTestMock();

    // 扩增程序
    Q_INVOKABLE  QVariantList   getProgramInfo(QString);
    Q_INVOKABLE  int            deleteProgramInfo(QString);                 // 0 成功 1失败
    Q_INVOKABLE  int            deleteAllProgramInfo();                     // 0 成功 1失败
    Q_INVOKABLE  int            setDefaultProgram(QString, QString);        // 0 成功 1失败
    Q_INVOKABLE  QVariantList   getProgramStepInfo(QString);                // 暂时只返步骤
    Q_INVOKABLE  QString        saveProgramInfo(QVariantMap, QVariantList); // 1.成功 2.校验失败原因


    // 实验运行
    Q_INVOKABLE QVector<QVector<QPointF>>    getChartInfo(int equId, QString accessInfo, QString posInfo);
    Q_INVOKABLE QMap<QString, QVariantList>     getBarChartInfo(int eqId, QString accessInfo, QString posiInfo);
    Q_INVOKABLE QVariantMap     getOtherInfo(QString);

    Q_INVOKABLE void             appendChild();


public:
    QQmlApplicationEngine* engine;
    QQuickWindow* qmlWindow;

};

#endif // MOCKINTERFACE_H
